<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
	<meta charset="utf-8">
	<meta name="Content-Type" tip_content="text/html;charset=utf-8">
	<meta name="keywords" tip_content="论坛">
	<title>逍遥论坛问答系统</title>
	<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <script th:src="@{/js/jquery-3.2.1.js}" ></script>
	<script th:src="@{/js/bootstrap.min.js}"></script>
	<style>
		li {
			list-style-type: none;
		}

		html,
		body {
			height: 100%;
			font-size: 14px;
			color: #525252;
			font-family: NotoSansHans-Regular, AvenirNext-Regular, arial,
				Hiragino Sans GB, "Microsoft Yahei", "Hiragino Sans GB",
				"WenQuanYi Micro Hei", sans-serif;
			background: #f0f2f5;
		}

		.footer {
			background-color: #fff;
			margin-top: 22px;
			margin-bottom: 22px;
			width: 100%;
			padding-top: 22px;
			color: #8A8A8A;
			display: block;
			height: 200px;
			border: 1px;
			clear: both
		}

		.container {
			margin-right: 5%;
			margin-left: 5%;
			padding-left: 15px;
			padding-right: 15px;
			width: 40%;
			float: left;
		}

		.info {
			margin-right: 5%;
			width: 10%;
			float: left;
		}

		a {
			color: #8A8A8A;
			cursor: pointer;
		}
	</style>
</head>

<body>

	<!-- <c:if test="${not empty myInfo}">
		<script type="text/javascript" language="javascript">
        // {
        //     alert("<%=request.getAttribute("myInfo")%>");
        // }
		</script>
	</c:if> -->

	<!-- 引入header文件 -->
	<header th:insert="~{header :: header}"></header>

	<div class="panel panel-default" id="main" style="width: 70%; margin: 1% 2% 5% 5%; float: left;">
		<form role="form" method="post" action="searchTipByKeyword.do">
			<div class="input-group col-md-3" style="margin-top: 2px; float: left; text-align: center;">
				<input type="text" class="form-control" id="keyword" name="keyword" placeholder="请输入要搜索的内容" /> <span
					class="input-group-btn">
					<button type="submit" class="btn btn-info btn-search">搜索</button>
				</span>
			</div>
		</form>
		<div class="panel-heading" style="background-color: white">
			<a style="margin-left: 2%">活跃</a> <a style="margin-left: 2%">精华</a> <a style="margin-left: 2%">最近</a>
		</div>
		<ul class="list-group" style="width: 100%" th:each="tip:${tips}" th:if="${tip.tipIsDeleted!= 1}">
			<li class="list-group-item">
				<div style="height: 50px">
					<div style="width: 89%; float: left">
						<!-- 这里显示贴子标题，点击贴子跳转到贴子详情，需要传参贴子id -->
						<a th:href="'showTip.do?tipId='+tip.tipId" th:text="${tip.tipTitle}"></a>&nbsp;
						<span class="label label-success" th:if="${tip.tipIsKnot == 1}">结贴</span>
						<br>
						<div>
							<!-- 显示贴子对应的版块 -->
							<a><span class="label label-primary" th:text="${tip.forumName}"></span></a>
							<!-- 显示贴子对应的分类 -->
							<a><span class="label label-warning" th:text="${tip.tabName}"></span></a>
							&nbsp;&nbsp;&nbsp;
							<!-- 点击用户跳转到用户信息页面，需要传参用户id -->
							<a th:href="${'getUserInfo.do?userId='+tip.userId}"> <span>
									<span th:switch="${tip.userNick}!=null">
										<span th:case="true" th:text=${tip.userNick}></span>
										<span th:case="false" th:text=${tip.userName}></span>
									</span>
								</span>
							</a> &nbsp;&nbsp;&nbsp;
							<!-- 显示贴子发表时间 -->
							<small class="text-muted">
								<span
									th:text="${'发表时间：' +  #dates.format(tip.tipPublishTime, 'yyyy-MM-dd HH:mm:ss')}"></span>
								&nbsp;&nbsp;
								<span
									th:text="${'更新时间：' +  #dates.format(tip.tipModifyTime, 'yyyy-MM-dd HH:mm:ss')}"></span>
								&nbsp;&nbsp;
								<span class="label label-warning" title="点击量" th:text="${tip.tipClick + '次点击'}"></span>
							</small>
						</div>
					</div>
					<div style="width: 5%; float: right; text-align: center">
						<span class="label label-info" title="回复数" th:text="${tip.tipReplies}">
							<!-- 这里显示贴子回复量 -->条回复
						</span>
					</div>
				</div>
			</li>
		</ul>
	</div>
	<!-- 引入侧边栏文件 -->
	<side th:insert="~{side :: side}"></side>
	<!-- 引入footer文件 -->
	<footer th:insert="~{footer :: footer}"></footer>
</body>

</html>